﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Renci.iRods.Common;

namespace Renci.iRods.Packets
{
    //#define userAdminInp_PI "str *arg0; str *arg1; str *arg2; str *arg3; str *arg4; str *arg5; str *arg6; str *arg7;  str *arg8;  str *arg9;"
    [Packet("userAdminInp_PI")]
    internal class UserAdminInputPacket : Packet
    {
        [PacketField("arg0", 0, DataTypes.String)]
        public string Argument0 { get; private set; }

        [PacketField("arg1", 1, DataTypes.String)]
        public string Argument1 { get; private set; }

        [PacketField("arg2", 2, DataTypes.String)]
        public string Argument2 { get; private set; }

        [PacketField("arg3", 3, DataTypes.String)]
        public string Argument3 { get; private set; }

        [PacketField("arg4", 4, DataTypes.String)]
        public string Argument4 { get; private set; }

        [PacketField("arg5", 5, DataTypes.String)]
        public string Argument5 { get; private set; }

        [PacketField("arg6", 6, DataTypes.String)]
        public string Argument6 { get; private set; }

        [PacketField("arg7", 7, DataTypes.String)]
        public string Argument7 { get; private set; }

        [PacketField("arg8", 8, DataTypes.String)]
        public string Argument8 { get; private set; }

        [PacketField("arg9", 9, DataTypes.String)]
        public string Argument9 { get; private set; }

        public UserAdminInputPacket(params string[] arguments)
        {
            if (arguments.Length > 10)
                throw new InvalidOperationException();

            if (arguments.Length > 0)
                this.Argument0 = arguments[0];

            if (arguments.Length > 1)
                this.Argument1 = arguments[1];

            if (arguments.Length > 2)
                this.Argument2 = arguments[2];

            if (arguments.Length > 3)
                this.Argument3 = arguments[3];

            if (arguments.Length > 4)
                this.Argument4 = arguments[4];

            if (arguments.Length > 5)
                this.Argument5 = arguments[5];

            if (arguments.Length > 6)
                this.Argument6 = arguments[6];

            if (arguments.Length > 7)
                this.Argument7 = arguments[7];
            if (arguments.Length > 8)
                this.Argument8 = arguments[8];

            if (arguments.Length > 9)
                this.Argument9 = arguments[9];
        }
    }
}
